#ifndef __X_STRING_H__
#define __X_STRING_H__

#include "xobject.h"
#include <string>

class xString : public xObject
{
public:
    xString();
    xString(const char *str);
    xString(const std::string &str);
    xString(const xString &str);

    virtual ~xString();

    // Override assignment operator
    xString &operator=(const xString &other);

    // Init a string with format, it's similar with the c funciton 'sprintf'
    bool initWithFormat(const char *format, ...);

    // Convert to int value
    int intValue() const;

    // Convert to unsigned int value
    unsigned int uintValue() const;

    // Convert to double value
    double doubleValue() const;

    // Convert to bool value
    bool boolValue() const;

    // Get the C string
    const char *getCString() const;

    // Get the length of string
    unsigned int length() const;

    // Compare to a C string
    int compare(const char *) const;

    // Override functions
    virtual bool isEqual(const xObject *object);

    static xString *create(const std::string *str);

    static xString *createWithFormat(const char *format, ...);

    static xString *createWithData(const unsigned char *data, unsigned long length);

    static xString *createWithContentsOfFile(const char *fileName);

private:





};

#endif // __X_STRING_H__